import en from "@/lang/config/en";
import zh from "@/lang/config/zh";
import zhHk from "@/lang/config/zh-hk";
import {LANGUAGE, storage} from "@/utils/storage";
import {createI18n} from "vue-i18n";

const messages = {
    'zh':{...zh},
    'zh-hk':{...zhHk},
    'en':{...en}
}

// //浏览器语言
// const lang =(navigator.language||'en').toLocaleLowerCase()
// //!存储在本地，若本地没有，采用浏览器语言
// const language = storage.get(LANGUAGE)|| lang.split('_')[0] || 'zh';
// storage.set(LANGUAGE, language)

const i18n= new createI18n({
    locale: 'zh',
    messages
});
export default i18n;
